package edu.uwaterloo.bicycle.parser.antlr.internal; 

import org.eclipse.xtext.*;
import org.eclipse.xtext.parser.*;
import org.eclipse.xtext.parser.impl.*;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser;
import org.eclipse.xtext.parser.antlr.XtextTokenStream;
import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens;
import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken;
import edu.uwaterloo.bicycle.services.ModeLanguageGrammarAccess;



import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

@SuppressWarnings("all")
public class InternalModeLanguageParser extends AbstractInternalAntlrParser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "RULE_MNAME", "RULE_TYPES", "RULE_NUMBER", "RULE_BUILT_IN_MODES", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "'MODE'", "'INVISIBLE'", "'TYPE'", "'CONDITION'", "'EXPRESSION'", "'AND'", "'OR'", "'>'", "'<'", "'='", "'+'", "'-'", "'*'", "'/'", "'%'", "'('", "')'"
    };
    public static final int T__27=27;
    public static final int T__26=26;
    public static final int T__25=25;
    public static final int T__24=24;
    public static final int T__23=23;
    public static final int T__22=22;
    public static final int T__21=21;
    public static final int T__20=20;
    public static final int RULE_SL_COMMENT=9;
    public static final int EOF=-1;
    public static final int RULE_TYPES=5;
    public static final int RULE_ML_COMMENT=8;
    public static final int T__19=19;
    public static final int RULE_MNAME=4;
    public static final int T__16=16;
    public static final int T__15=15;
    public static final int T__18=18;
    public static final int T__17=17;
    public static final int RULE_NUMBER=6;
    public static final int T__12=12;
    public static final int T__11=11;
    public static final int T__14=14;
    public static final int T__13=13;
    public static final int RULE_WS=10;
    public static final int RULE_BUILT_IN_MODES=7;

    // delegates
    // delegators


        public InternalModeLanguageParser(TokenStream input) {
            this(input, new RecognizerSharedState());
        }
        public InternalModeLanguageParser(TokenStream input, RecognizerSharedState state) {
            super(input, state);
             
        }
        

    public String[] getTokenNames() { return InternalModeLanguageParser.tokenNames; }
    public String getGrammarFileName() { return "../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g"; }



     	private ModeLanguageGrammarAccess grammarAccess;
     	
        public InternalModeLanguageParser(TokenStream input, ModeLanguageGrammarAccess grammarAccess) {
            this(input);
            this.grammarAccess = grammarAccess;
            registerRules(grammarAccess.getGrammar());
        }
        
        @Override
        protected String getFirstRuleName() {
        	return "Model";	
       	}
       	
       	@Override
       	protected ModeLanguageGrammarAccess getGrammarAccess() {
       		return grammarAccess;
       	}



    // $ANTLR start "entryRuleModel"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:67:1: entryRuleModel returns [EObject current=null] : iv_ruleModel= ruleModel EOF ;
    public final EObject entryRuleModel() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleModel = null;


        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:68:2: (iv_ruleModel= ruleModel EOF )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:69:2: iv_ruleModel= ruleModel EOF
            {
             newCompositeNode(grammarAccess.getModelRule()); 
            pushFollow(FOLLOW_ruleModel_in_entryRuleModel75);
            iv_ruleModel=ruleModel();

            state._fsp--;

             current =iv_ruleModel; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleModel85); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleModel"


    // $ANTLR start "ruleModel"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:76:1: ruleModel returns [EObject current=null] : ( (lv_modes_0_0= ruleMode ) )* ;
    public final EObject ruleModel() throws RecognitionException {
        EObject current = null;

        EObject lv_modes_0_0 = null;


         enterRule(); 
            
        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:79:28: ( ( (lv_modes_0_0= ruleMode ) )* )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:80:1: ( (lv_modes_0_0= ruleMode ) )*
            {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:80:1: ( (lv_modes_0_0= ruleMode ) )*
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==11) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:81:1: (lv_modes_0_0= ruleMode )
            	    {
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:81:1: (lv_modes_0_0= ruleMode )
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:82:3: lv_modes_0_0= ruleMode
            	    {
            	     
            	    	        newCompositeNode(grammarAccess.getModelAccess().getModesModeParserRuleCall_0()); 
            	    	    
            	    pushFollow(FOLLOW_ruleMode_in_ruleModel130);
            	    lv_modes_0_0=ruleMode();

            	    state._fsp--;


            	    	        if (current==null) {
            	    	            current = createModelElementForParent(grammarAccess.getModelRule());
            	    	        }
            	           		add(
            	           			current, 
            	           			"modes",
            	            		lv_modes_0_0, 
            	            		"Mode");
            	    	        afterParserOrEnumRuleCall();
            	    	    

            	    }


            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleModel"


    // $ANTLR start "entryRuleMode"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:106:1: entryRuleMode returns [EObject current=null] : iv_ruleMode= ruleMode EOF ;
    public final EObject entryRuleMode() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleMode = null;


        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:107:2: (iv_ruleMode= ruleMode EOF )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:108:2: iv_ruleMode= ruleMode EOF
            {
             newCompositeNode(grammarAccess.getModeRule()); 
            pushFollow(FOLLOW_ruleMode_in_entryRuleMode166);
            iv_ruleMode=ruleMode();

            state._fsp--;

             current =iv_ruleMode; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleMode176); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleMode"


    // $ANTLR start "ruleMode"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:115:1: ruleMode returns [EObject current=null] : (otherlv_0= 'MODE' ( (lv_name_1_0= RULE_MNAME ) ) ( (lv_inv_2_0= 'INVISIBLE' ) )? otherlv_3= 'TYPE' ( (lv_type_4_0= RULE_TYPES ) ) (otherlv_5= 'CONDITION' ( (lv_condition_6_0= ruleConditions ) ) )? otherlv_7= 'EXPRESSION' ( (lv_expr_8_0= ruleExpression ) ) ) ;
    public final EObject ruleMode() throws RecognitionException {
        EObject current = null;

        Token otherlv_0=null;
        Token lv_name_1_0=null;
        Token lv_inv_2_0=null;
        Token otherlv_3=null;
        Token lv_type_4_0=null;
        Token otherlv_5=null;
        Token otherlv_7=null;
        EObject lv_condition_6_0 = null;

        EObject lv_expr_8_0 = null;


         enterRule(); 
            
        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:118:28: ( (otherlv_0= 'MODE' ( (lv_name_1_0= RULE_MNAME ) ) ( (lv_inv_2_0= 'INVISIBLE' ) )? otherlv_3= 'TYPE' ( (lv_type_4_0= RULE_TYPES ) ) (otherlv_5= 'CONDITION' ( (lv_condition_6_0= ruleConditions ) ) )? otherlv_7= 'EXPRESSION' ( (lv_expr_8_0= ruleExpression ) ) ) )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:119:1: (otherlv_0= 'MODE' ( (lv_name_1_0= RULE_MNAME ) ) ( (lv_inv_2_0= 'INVISIBLE' ) )? otherlv_3= 'TYPE' ( (lv_type_4_0= RULE_TYPES ) ) (otherlv_5= 'CONDITION' ( (lv_condition_6_0= ruleConditions ) ) )? otherlv_7= 'EXPRESSION' ( (lv_expr_8_0= ruleExpression ) ) )
            {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:119:1: (otherlv_0= 'MODE' ( (lv_name_1_0= RULE_MNAME ) ) ( (lv_inv_2_0= 'INVISIBLE' ) )? otherlv_3= 'TYPE' ( (lv_type_4_0= RULE_TYPES ) ) (otherlv_5= 'CONDITION' ( (lv_condition_6_0= ruleConditions ) ) )? otherlv_7= 'EXPRESSION' ( (lv_expr_8_0= ruleExpression ) ) )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:119:3: otherlv_0= 'MODE' ( (lv_name_1_0= RULE_MNAME ) ) ( (lv_inv_2_0= 'INVISIBLE' ) )? otherlv_3= 'TYPE' ( (lv_type_4_0= RULE_TYPES ) ) (otherlv_5= 'CONDITION' ( (lv_condition_6_0= ruleConditions ) ) )? otherlv_7= 'EXPRESSION' ( (lv_expr_8_0= ruleExpression ) )
            {
            otherlv_0=(Token)match(input,11,FOLLOW_11_in_ruleMode213); 

                	newLeafNode(otherlv_0, grammarAccess.getModeAccess().getMODEKeyword_0());
                
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:123:1: ( (lv_name_1_0= RULE_MNAME ) )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:124:1: (lv_name_1_0= RULE_MNAME )
            {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:124:1: (lv_name_1_0= RULE_MNAME )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:125:3: lv_name_1_0= RULE_MNAME
            {
            lv_name_1_0=(Token)match(input,RULE_MNAME,FOLLOW_RULE_MNAME_in_ruleMode230); 

            			newLeafNode(lv_name_1_0, grammarAccess.getModeAccess().getNameMNAMETerminalRuleCall_1_0()); 
            		

            	        if (current==null) {
            	            current = createModelElement(grammarAccess.getModeRule());
            	        }
                   		setWithLastConsumed(
                   			current, 
                   			"name",
                    		lv_name_1_0, 
                    		"MNAME");
            	    

            }


            }

            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:141:2: ( (lv_inv_2_0= 'INVISIBLE' ) )?
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( (LA2_0==12) ) {
                alt2=1;
            }
            switch (alt2) {
                case 1 :
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:142:1: (lv_inv_2_0= 'INVISIBLE' )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:142:1: (lv_inv_2_0= 'INVISIBLE' )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:143:3: lv_inv_2_0= 'INVISIBLE'
                    {
                    lv_inv_2_0=(Token)match(input,12,FOLLOW_12_in_ruleMode253); 

                            newLeafNode(lv_inv_2_0, grammarAccess.getModeAccess().getInvINVISIBLEKeyword_2_0());
                        

                    	        if (current==null) {
                    	            current = createModelElement(grammarAccess.getModeRule());
                    	        }
                           		setWithLastConsumed(current, "inv", true, "INVISIBLE");
                    	    

                    }


                    }
                    break;

            }

            otherlv_3=(Token)match(input,13,FOLLOW_13_in_ruleMode279); 

                	newLeafNode(otherlv_3, grammarAccess.getModeAccess().getTYPEKeyword_3());
                
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:160:1: ( (lv_type_4_0= RULE_TYPES ) )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:161:1: (lv_type_4_0= RULE_TYPES )
            {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:161:1: (lv_type_4_0= RULE_TYPES )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:162:3: lv_type_4_0= RULE_TYPES
            {
            lv_type_4_0=(Token)match(input,RULE_TYPES,FOLLOW_RULE_TYPES_in_ruleMode296); 

            			newLeafNode(lv_type_4_0, grammarAccess.getModeAccess().getTypeTYPESTerminalRuleCall_4_0()); 
            		

            	        if (current==null) {
            	            current = createModelElement(grammarAccess.getModeRule());
            	        }
                   		setWithLastConsumed(
                   			current, 
                   			"type",
                    		lv_type_4_0, 
                    		"TYPES");
            	    

            }


            }

            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:178:2: (otherlv_5= 'CONDITION' ( (lv_condition_6_0= ruleConditions ) ) )?
            int alt3=2;
            int LA3_0 = input.LA(1);

            if ( (LA3_0==14) ) {
                alt3=1;
            }
            switch (alt3) {
                case 1 :
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:178:4: otherlv_5= 'CONDITION' ( (lv_condition_6_0= ruleConditions ) )
                    {
                    otherlv_5=(Token)match(input,14,FOLLOW_14_in_ruleMode314); 

                        	newLeafNode(otherlv_5, grammarAccess.getModeAccess().getCONDITIONKeyword_5_0());
                        
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:182:1: ( (lv_condition_6_0= ruleConditions ) )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:183:1: (lv_condition_6_0= ruleConditions )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:183:1: (lv_condition_6_0= ruleConditions )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:184:3: lv_condition_6_0= ruleConditions
                    {
                     
                    	        newCompositeNode(grammarAccess.getModeAccess().getConditionConditionsParserRuleCall_5_1_0()); 
                    	    
                    pushFollow(FOLLOW_ruleConditions_in_ruleMode335);
                    lv_condition_6_0=ruleConditions();

                    state._fsp--;


                    	        if (current==null) {
                    	            current = createModelElementForParent(grammarAccess.getModeRule());
                    	        }
                           		set(
                           			current, 
                           			"condition",
                            		lv_condition_6_0, 
                            		"Conditions");
                    	        afterParserOrEnumRuleCall();
                    	    

                    }


                    }


                    }
                    break;

            }

            otherlv_7=(Token)match(input,15,FOLLOW_15_in_ruleMode349); 

                	newLeafNode(otherlv_7, grammarAccess.getModeAccess().getEXPRESSIONKeyword_6());
                
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:204:1: ( (lv_expr_8_0= ruleExpression ) )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:205:1: (lv_expr_8_0= ruleExpression )
            {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:205:1: (lv_expr_8_0= ruleExpression )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:206:3: lv_expr_8_0= ruleExpression
            {
             
            	        newCompositeNode(grammarAccess.getModeAccess().getExprExpressionParserRuleCall_7_0()); 
            	    
            pushFollow(FOLLOW_ruleExpression_in_ruleMode370);
            lv_expr_8_0=ruleExpression();

            state._fsp--;


            	        if (current==null) {
            	            current = createModelElementForParent(grammarAccess.getModeRule());
            	        }
                   		set(
                   			current, 
                   			"expr",
                    		lv_expr_8_0, 
                    		"Expression");
            	        afterParserOrEnumRuleCall();
            	    

            }


            }


            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleMode"


    // $ANTLR start "entryRuleConditions"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:230:1: entryRuleConditions returns [EObject current=null] : iv_ruleConditions= ruleConditions EOF ;
    public final EObject entryRuleConditions() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleConditions = null;


        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:231:2: (iv_ruleConditions= ruleConditions EOF )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:232:2: iv_ruleConditions= ruleConditions EOF
            {
             newCompositeNode(grammarAccess.getConditionsRule()); 
            pushFollow(FOLLOW_ruleConditions_in_entryRuleConditions406);
            iv_ruleConditions=ruleConditions();

            state._fsp--;

             current =iv_ruleConditions; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleConditions416); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleConditions"


    // $ANTLR start "ruleConditions"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:239:1: ruleConditions returns [EObject current=null] : this_CompoundCondition_0= ruleCompoundCondition ;
    public final EObject ruleConditions() throws RecognitionException {
        EObject current = null;

        EObject this_CompoundCondition_0 = null;


         enterRule(); 
            
        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:242:28: (this_CompoundCondition_0= ruleCompoundCondition )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:244:5: this_CompoundCondition_0= ruleCompoundCondition
            {
             
                    newCompositeNode(grammarAccess.getConditionsAccess().getCompoundConditionParserRuleCall()); 
                
            pushFollow(FOLLOW_ruleCompoundCondition_in_ruleConditions462);
            this_CompoundCondition_0=ruleCompoundCondition();

            state._fsp--;

             
                    current = this_CompoundCondition_0; 
                    afterParserOrEnumRuleCall();
                

            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleConditions"


    // $ANTLR start "entryRuleCompoundCondition"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:260:1: entryRuleCompoundCondition returns [EObject current=null] : iv_ruleCompoundCondition= ruleCompoundCondition EOF ;
    public final EObject entryRuleCompoundCondition() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleCompoundCondition = null;


        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:261:2: (iv_ruleCompoundCondition= ruleCompoundCondition EOF )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:262:2: iv_ruleCompoundCondition= ruleCompoundCondition EOF
            {
             newCompositeNode(grammarAccess.getCompoundConditionRule()); 
            pushFollow(FOLLOW_ruleCompoundCondition_in_entryRuleCompoundCondition496);
            iv_ruleCompoundCondition=ruleCompoundCondition();

            state._fsp--;

             current =iv_ruleCompoundCondition; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleCompoundCondition506); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleCompoundCondition"


    // $ANTLR start "ruleCompoundCondition"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:269:1: ruleCompoundCondition returns [EObject current=null] : (this_Condition_0= ruleCondition ( ( ( () otherlv_2= 'AND' ) | ( () otherlv_4= 'OR' ) ) ( (lv_right_5_0= ruleCondition ) ) )* ) ;
    public final EObject ruleCompoundCondition() throws RecognitionException {
        EObject current = null;

        Token otherlv_2=null;
        Token otherlv_4=null;
        EObject this_Condition_0 = null;

        EObject lv_right_5_0 = null;


         enterRule(); 
            
        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:272:28: ( (this_Condition_0= ruleCondition ( ( ( () otherlv_2= 'AND' ) | ( () otherlv_4= 'OR' ) ) ( (lv_right_5_0= ruleCondition ) ) )* ) )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:273:1: (this_Condition_0= ruleCondition ( ( ( () otherlv_2= 'AND' ) | ( () otherlv_4= 'OR' ) ) ( (lv_right_5_0= ruleCondition ) ) )* )
            {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:273:1: (this_Condition_0= ruleCondition ( ( ( () otherlv_2= 'AND' ) | ( () otherlv_4= 'OR' ) ) ( (lv_right_5_0= ruleCondition ) ) )* )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:274:5: this_Condition_0= ruleCondition ( ( ( () otherlv_2= 'AND' ) | ( () otherlv_4= 'OR' ) ) ( (lv_right_5_0= ruleCondition ) ) )*
            {
             
                    newCompositeNode(grammarAccess.getCompoundConditionAccess().getConditionParserRuleCall_0()); 
                
            pushFollow(FOLLOW_ruleCondition_in_ruleCompoundCondition553);
            this_Condition_0=ruleCondition();

            state._fsp--;

             
                    current = this_Condition_0; 
                    afterParserOrEnumRuleCall();
                
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:282:1: ( ( ( () otherlv_2= 'AND' ) | ( () otherlv_4= 'OR' ) ) ( (lv_right_5_0= ruleCondition ) ) )*
            loop5:
            do {
                int alt5=2;
                int LA5_0 = input.LA(1);

                if ( ((LA5_0>=16 && LA5_0<=17)) ) {
                    alt5=1;
                }


                switch (alt5) {
            	case 1 :
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:282:2: ( ( () otherlv_2= 'AND' ) | ( () otherlv_4= 'OR' ) ) ( (lv_right_5_0= ruleCondition ) )
            	    {
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:282:2: ( ( () otherlv_2= 'AND' ) | ( () otherlv_4= 'OR' ) )
            	    int alt4=2;
            	    int LA4_0 = input.LA(1);

            	    if ( (LA4_0==16) ) {
            	        alt4=1;
            	    }
            	    else if ( (LA4_0==17) ) {
            	        alt4=2;
            	    }
            	    else {
            	        NoViableAltException nvae =
            	            new NoViableAltException("", 4, 0, input);

            	        throw nvae;
            	    }
            	    switch (alt4) {
            	        case 1 :
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:282:3: ( () otherlv_2= 'AND' )
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:282:3: ( () otherlv_2= 'AND' )
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:282:4: () otherlv_2= 'AND'
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:282:4: ()
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:283:5: 
            	            {

            	                    current = forceCreateModelElementAndSet(
            	                        grammarAccess.getCompoundConditionAccess().getAndCondLeftAction_1_0_0_0(),
            	                        current);
            	                

            	            }

            	            otherlv_2=(Token)match(input,16,FOLLOW_16_in_ruleCompoundCondition576); 

            	                	newLeafNode(otherlv_2, grammarAccess.getCompoundConditionAccess().getANDKeyword_1_0_0_1());
            	                

            	            }


            	            }
            	            break;
            	        case 2 :
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:293:6: ( () otherlv_4= 'OR' )
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:293:6: ( () otherlv_4= 'OR' )
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:293:7: () otherlv_4= 'OR'
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:293:7: ()
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:294:5: 
            	            {

            	                    current = forceCreateModelElementAndSet(
            	                        grammarAccess.getCompoundConditionAccess().getOrCondLeftAction_1_0_1_0(),
            	                        current);
            	                

            	            }

            	            otherlv_4=(Token)match(input,17,FOLLOW_17_in_ruleCompoundCondition605); 

            	                	newLeafNode(otherlv_4, grammarAccess.getCompoundConditionAccess().getORKeyword_1_0_1_1());
            	                

            	            }


            	            }
            	            break;

            	    }

            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:303:3: ( (lv_right_5_0= ruleCondition ) )
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:304:1: (lv_right_5_0= ruleCondition )
            	    {
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:304:1: (lv_right_5_0= ruleCondition )
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:305:3: lv_right_5_0= ruleCondition
            	    {
            	     
            	    	        newCompositeNode(grammarAccess.getCompoundConditionAccess().getRightConditionParserRuleCall_1_1_0()); 
            	    	    
            	    pushFollow(FOLLOW_ruleCondition_in_ruleCompoundCondition628);
            	    lv_right_5_0=ruleCondition();

            	    state._fsp--;


            	    	        if (current==null) {
            	    	            current = createModelElementForParent(grammarAccess.getCompoundConditionRule());
            	    	        }
            	           		set(
            	           			current, 
            	           			"right",
            	            		lv_right_5_0, 
            	            		"Condition");
            	    	        afterParserOrEnumRuleCall();
            	    	    

            	    }


            	    }


            	    }
            	    break;

            	default :
            	    break loop5;
                }
            } while (true);


            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleCompoundCondition"


    // $ANTLR start "entryRuleCondition"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:329:1: entryRuleCondition returns [EObject current=null] : iv_ruleCondition= ruleCondition EOF ;
    public final EObject entryRuleCondition() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleCondition = null;


        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:330:2: (iv_ruleCondition= ruleCondition EOF )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:331:2: iv_ruleCondition= ruleCondition EOF
            {
             newCompositeNode(grammarAccess.getConditionRule()); 
            pushFollow(FOLLOW_ruleCondition_in_entryRuleCondition666);
            iv_ruleCondition=ruleCondition();

            state._fsp--;

             current =iv_ruleCondition; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleCondition676); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleCondition"


    // $ANTLR start "ruleCondition"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:338:1: ruleCondition returns [EObject current=null] : (this_Expression_0= ruleExpression ( ( () otherlv_2= '>' ) | ( () otherlv_4= '<' ) | ( () otherlv_6= '=' ) ) ( (lv_right_7_0= ruleExpression ) ) ) ;
    public final EObject ruleCondition() throws RecognitionException {
        EObject current = null;

        Token otherlv_2=null;
        Token otherlv_4=null;
        Token otherlv_6=null;
        EObject this_Expression_0 = null;

        EObject lv_right_7_0 = null;


         enterRule(); 
            
        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:341:28: ( (this_Expression_0= ruleExpression ( ( () otherlv_2= '>' ) | ( () otherlv_4= '<' ) | ( () otherlv_6= '=' ) ) ( (lv_right_7_0= ruleExpression ) ) ) )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:342:1: (this_Expression_0= ruleExpression ( ( () otherlv_2= '>' ) | ( () otherlv_4= '<' ) | ( () otherlv_6= '=' ) ) ( (lv_right_7_0= ruleExpression ) ) )
            {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:342:1: (this_Expression_0= ruleExpression ( ( () otherlv_2= '>' ) | ( () otherlv_4= '<' ) | ( () otherlv_6= '=' ) ) ( (lv_right_7_0= ruleExpression ) ) )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:343:5: this_Expression_0= ruleExpression ( ( () otherlv_2= '>' ) | ( () otherlv_4= '<' ) | ( () otherlv_6= '=' ) ) ( (lv_right_7_0= ruleExpression ) )
            {
             
                    newCompositeNode(grammarAccess.getConditionAccess().getExpressionParserRuleCall_0()); 
                
            pushFollow(FOLLOW_ruleExpression_in_ruleCondition723);
            this_Expression_0=ruleExpression();

            state._fsp--;

             
                    current = this_Expression_0; 
                    afterParserOrEnumRuleCall();
                
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:351:1: ( ( () otherlv_2= '>' ) | ( () otherlv_4= '<' ) | ( () otherlv_6= '=' ) )
            int alt6=3;
            switch ( input.LA(1) ) {
            case 18:
                {
                alt6=1;
                }
                break;
            case 19:
                {
                alt6=2;
                }
                break;
            case 20:
                {
                alt6=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 6, 0, input);

                throw nvae;
            }

            switch (alt6) {
                case 1 :
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:351:2: ( () otherlv_2= '>' )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:351:2: ( () otherlv_2= '>' )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:351:3: () otherlv_2= '>'
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:351:3: ()
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:352:5: 
                    {

                            current = forceCreateModelElementAndSet(
                                grammarAccess.getConditionAccess().getGreaterThanLeftAction_1_0_0(),
                                current);
                        

                    }

                    otherlv_2=(Token)match(input,18,FOLLOW_18_in_ruleCondition745); 

                        	newLeafNode(otherlv_2, grammarAccess.getConditionAccess().getGreaterThanSignKeyword_1_0_1());
                        

                    }


                    }
                    break;
                case 2 :
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:362:6: ( () otherlv_4= '<' )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:362:6: ( () otherlv_4= '<' )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:362:7: () otherlv_4= '<'
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:362:7: ()
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:363:5: 
                    {

                            current = forceCreateModelElementAndSet(
                                grammarAccess.getConditionAccess().getLessThanLeftAction_1_1_0(),
                                current);
                        

                    }

                    otherlv_4=(Token)match(input,19,FOLLOW_19_in_ruleCondition774); 

                        	newLeafNode(otherlv_4, grammarAccess.getConditionAccess().getLessThanSignKeyword_1_1_1());
                        

                    }


                    }
                    break;
                case 3 :
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:373:6: ( () otherlv_6= '=' )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:373:6: ( () otherlv_6= '=' )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:373:7: () otherlv_6= '='
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:373:7: ()
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:374:5: 
                    {

                            current = forceCreateModelElementAndSet(
                                grammarAccess.getConditionAccess().getEqualToLeftAction_1_2_0(),
                                current);
                        

                    }

                    otherlv_6=(Token)match(input,20,FOLLOW_20_in_ruleCondition803); 

                        	newLeafNode(otherlv_6, grammarAccess.getConditionAccess().getEqualsSignKeyword_1_2_1());
                        

                    }


                    }
                    break;

            }

            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:383:3: ( (lv_right_7_0= ruleExpression ) )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:384:1: (lv_right_7_0= ruleExpression )
            {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:384:1: (lv_right_7_0= ruleExpression )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:385:3: lv_right_7_0= ruleExpression
            {
             
            	        newCompositeNode(grammarAccess.getConditionAccess().getRightExpressionParserRuleCall_2_0()); 
            	    
            pushFollow(FOLLOW_ruleExpression_in_ruleCondition826);
            lv_right_7_0=ruleExpression();

            state._fsp--;


            	        if (current==null) {
            	            current = createModelElementForParent(grammarAccess.getConditionRule());
            	        }
                   		set(
                   			current, 
                   			"right",
                    		lv_right_7_0, 
                    		"Expression");
            	        afterParserOrEnumRuleCall();
            	    

            }


            }


            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleCondition"


    // $ANTLR start "entryRuleExpression"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:409:1: entryRuleExpression returns [EObject current=null] : iv_ruleExpression= ruleExpression EOF ;
    public final EObject entryRuleExpression() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleExpression = null;


        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:410:2: (iv_ruleExpression= ruleExpression EOF )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:411:2: iv_ruleExpression= ruleExpression EOF
            {
             newCompositeNode(grammarAccess.getExpressionRule()); 
            pushFollow(FOLLOW_ruleExpression_in_entryRuleExpression862);
            iv_ruleExpression=ruleExpression();

            state._fsp--;

             current =iv_ruleExpression; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleExpression872); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleExpression"


    // $ANTLR start "ruleExpression"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:418:1: ruleExpression returns [EObject current=null] : this_Addition_0= ruleAddition ;
    public final EObject ruleExpression() throws RecognitionException {
        EObject current = null;

        EObject this_Addition_0 = null;


         enterRule(); 
            
        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:421:28: (this_Addition_0= ruleAddition )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:423:5: this_Addition_0= ruleAddition
            {
             
                    newCompositeNode(grammarAccess.getExpressionAccess().getAdditionParserRuleCall()); 
                
            pushFollow(FOLLOW_ruleAddition_in_ruleExpression918);
            this_Addition_0=ruleAddition();

            state._fsp--;

             
                    current = this_Addition_0; 
                    afterParserOrEnumRuleCall();
                

            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleExpression"


    // $ANTLR start "entryRuleAddition"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:439:1: entryRuleAddition returns [EObject current=null] : iv_ruleAddition= ruleAddition EOF ;
    public final EObject entryRuleAddition() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleAddition = null;


        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:440:2: (iv_ruleAddition= ruleAddition EOF )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:441:2: iv_ruleAddition= ruleAddition EOF
            {
             newCompositeNode(grammarAccess.getAdditionRule()); 
            pushFollow(FOLLOW_ruleAddition_in_entryRuleAddition952);
            iv_ruleAddition=ruleAddition();

            state._fsp--;

             current =iv_ruleAddition; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleAddition962); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleAddition"


    // $ANTLR start "ruleAddition"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:448:1: ruleAddition returns [EObject current=null] : (this_Multiplication_0= ruleMultiplication ( ( ( () otherlv_2= '+' ) | ( () otherlv_4= '-' ) ) ( (lv_right_5_0= ruleMultiplication ) ) )* ) ;
    public final EObject ruleAddition() throws RecognitionException {
        EObject current = null;

        Token otherlv_2=null;
        Token otherlv_4=null;
        EObject this_Multiplication_0 = null;

        EObject lv_right_5_0 = null;


         enterRule(); 
            
        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:451:28: ( (this_Multiplication_0= ruleMultiplication ( ( ( () otherlv_2= '+' ) | ( () otherlv_4= '-' ) ) ( (lv_right_5_0= ruleMultiplication ) ) )* ) )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:452:1: (this_Multiplication_0= ruleMultiplication ( ( ( () otherlv_2= '+' ) | ( () otherlv_4= '-' ) ) ( (lv_right_5_0= ruleMultiplication ) ) )* )
            {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:452:1: (this_Multiplication_0= ruleMultiplication ( ( ( () otherlv_2= '+' ) | ( () otherlv_4= '-' ) ) ( (lv_right_5_0= ruleMultiplication ) ) )* )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:453:5: this_Multiplication_0= ruleMultiplication ( ( ( () otherlv_2= '+' ) | ( () otherlv_4= '-' ) ) ( (lv_right_5_0= ruleMultiplication ) ) )*
            {
             
                    newCompositeNode(grammarAccess.getAdditionAccess().getMultiplicationParserRuleCall_0()); 
                
            pushFollow(FOLLOW_ruleMultiplication_in_ruleAddition1009);
            this_Multiplication_0=ruleMultiplication();

            state._fsp--;

             
                    current = this_Multiplication_0; 
                    afterParserOrEnumRuleCall();
                
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:461:1: ( ( ( () otherlv_2= '+' ) | ( () otherlv_4= '-' ) ) ( (lv_right_5_0= ruleMultiplication ) ) )*
            loop8:
            do {
                int alt8=2;
                int LA8_0 = input.LA(1);

                if ( ((LA8_0>=21 && LA8_0<=22)) ) {
                    alt8=1;
                }


                switch (alt8) {
            	case 1 :
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:461:2: ( ( () otherlv_2= '+' ) | ( () otherlv_4= '-' ) ) ( (lv_right_5_0= ruleMultiplication ) )
            	    {
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:461:2: ( ( () otherlv_2= '+' ) | ( () otherlv_4= '-' ) )
            	    int alt7=2;
            	    int LA7_0 = input.LA(1);

            	    if ( (LA7_0==21) ) {
            	        alt7=1;
            	    }
            	    else if ( (LA7_0==22) ) {
            	        alt7=2;
            	    }
            	    else {
            	        NoViableAltException nvae =
            	            new NoViableAltException("", 7, 0, input);

            	        throw nvae;
            	    }
            	    switch (alt7) {
            	        case 1 :
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:461:3: ( () otherlv_2= '+' )
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:461:3: ( () otherlv_2= '+' )
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:461:4: () otherlv_2= '+'
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:461:4: ()
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:462:5: 
            	            {

            	                    current = forceCreateModelElementAndSet(
            	                        grammarAccess.getAdditionAccess().getPlusLeftAction_1_0_0_0(),
            	                        current);
            	                

            	            }

            	            otherlv_2=(Token)match(input,21,FOLLOW_21_in_ruleAddition1032); 

            	                	newLeafNode(otherlv_2, grammarAccess.getAdditionAccess().getPlusSignKeyword_1_0_0_1());
            	                

            	            }


            	            }
            	            break;
            	        case 2 :
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:472:6: ( () otherlv_4= '-' )
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:472:6: ( () otherlv_4= '-' )
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:472:7: () otherlv_4= '-'
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:472:7: ()
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:473:5: 
            	            {

            	                    current = forceCreateModelElementAndSet(
            	                        grammarAccess.getAdditionAccess().getMinusLeftAction_1_0_1_0(),
            	                        current);
            	                

            	            }

            	            otherlv_4=(Token)match(input,22,FOLLOW_22_in_ruleAddition1061); 

            	                	newLeafNode(otherlv_4, grammarAccess.getAdditionAccess().getHyphenMinusKeyword_1_0_1_1());
            	                

            	            }


            	            }
            	            break;

            	    }

            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:482:3: ( (lv_right_5_0= ruleMultiplication ) )
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:483:1: (lv_right_5_0= ruleMultiplication )
            	    {
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:483:1: (lv_right_5_0= ruleMultiplication )
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:484:3: lv_right_5_0= ruleMultiplication
            	    {
            	     
            	    	        newCompositeNode(grammarAccess.getAdditionAccess().getRightMultiplicationParserRuleCall_1_1_0()); 
            	    	    
            	    pushFollow(FOLLOW_ruleMultiplication_in_ruleAddition1084);
            	    lv_right_5_0=ruleMultiplication();

            	    state._fsp--;


            	    	        if (current==null) {
            	    	            current = createModelElementForParent(grammarAccess.getAdditionRule());
            	    	        }
            	           		set(
            	           			current, 
            	           			"right",
            	            		lv_right_5_0, 
            	            		"Multiplication");
            	    	        afterParserOrEnumRuleCall();
            	    	    

            	    }


            	    }


            	    }
            	    break;

            	default :
            	    break loop8;
                }
            } while (true);


            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleAddition"


    // $ANTLR start "entryRuleMultiplication"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:508:1: entryRuleMultiplication returns [EObject current=null] : iv_ruleMultiplication= ruleMultiplication EOF ;
    public final EObject entryRuleMultiplication() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleMultiplication = null;


        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:509:2: (iv_ruleMultiplication= ruleMultiplication EOF )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:510:2: iv_ruleMultiplication= ruleMultiplication EOF
            {
             newCompositeNode(grammarAccess.getMultiplicationRule()); 
            pushFollow(FOLLOW_ruleMultiplication_in_entryRuleMultiplication1122);
            iv_ruleMultiplication=ruleMultiplication();

            state._fsp--;

             current =iv_ruleMultiplication; 
            match(input,EOF,FOLLOW_EOF_in_entryRuleMultiplication1132); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRuleMultiplication"


    // $ANTLR start "ruleMultiplication"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:517:1: ruleMultiplication returns [EObject current=null] : (this_PrimaryExpression_0= rulePrimaryExpression ( ( ( () otherlv_2= '*' ) | ( () otherlv_4= '/' ) | ( () otherlv_6= '%' ) ) ( (lv_right_7_0= rulePrimaryExpression ) ) )* ) ;
    public final EObject ruleMultiplication() throws RecognitionException {
        EObject current = null;

        Token otherlv_2=null;
        Token otherlv_4=null;
        Token otherlv_6=null;
        EObject this_PrimaryExpression_0 = null;

        EObject lv_right_7_0 = null;


         enterRule(); 
            
        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:520:28: ( (this_PrimaryExpression_0= rulePrimaryExpression ( ( ( () otherlv_2= '*' ) | ( () otherlv_4= '/' ) | ( () otherlv_6= '%' ) ) ( (lv_right_7_0= rulePrimaryExpression ) ) )* ) )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:521:1: (this_PrimaryExpression_0= rulePrimaryExpression ( ( ( () otherlv_2= '*' ) | ( () otherlv_4= '/' ) | ( () otherlv_6= '%' ) ) ( (lv_right_7_0= rulePrimaryExpression ) ) )* )
            {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:521:1: (this_PrimaryExpression_0= rulePrimaryExpression ( ( ( () otherlv_2= '*' ) | ( () otherlv_4= '/' ) | ( () otherlv_6= '%' ) ) ( (lv_right_7_0= rulePrimaryExpression ) ) )* )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:522:5: this_PrimaryExpression_0= rulePrimaryExpression ( ( ( () otherlv_2= '*' ) | ( () otherlv_4= '/' ) | ( () otherlv_6= '%' ) ) ( (lv_right_7_0= rulePrimaryExpression ) ) )*
            {
             
                    newCompositeNode(grammarAccess.getMultiplicationAccess().getPrimaryExpressionParserRuleCall_0()); 
                
            pushFollow(FOLLOW_rulePrimaryExpression_in_ruleMultiplication1179);
            this_PrimaryExpression_0=rulePrimaryExpression();

            state._fsp--;

             
                    current = this_PrimaryExpression_0; 
                    afterParserOrEnumRuleCall();
                
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:530:1: ( ( ( () otherlv_2= '*' ) | ( () otherlv_4= '/' ) | ( () otherlv_6= '%' ) ) ( (lv_right_7_0= rulePrimaryExpression ) ) )*
            loop10:
            do {
                int alt10=2;
                int LA10_0 = input.LA(1);

                if ( ((LA10_0>=23 && LA10_0<=25)) ) {
                    alt10=1;
                }


                switch (alt10) {
            	case 1 :
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:530:2: ( ( () otherlv_2= '*' ) | ( () otherlv_4= '/' ) | ( () otherlv_6= '%' ) ) ( (lv_right_7_0= rulePrimaryExpression ) )
            	    {
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:530:2: ( ( () otherlv_2= '*' ) | ( () otherlv_4= '/' ) | ( () otherlv_6= '%' ) )
            	    int alt9=3;
            	    switch ( input.LA(1) ) {
            	    case 23:
            	        {
            	        alt9=1;
            	        }
            	        break;
            	    case 24:
            	        {
            	        alt9=2;
            	        }
            	        break;
            	    case 25:
            	        {
            	        alt9=3;
            	        }
            	        break;
            	    default:
            	        NoViableAltException nvae =
            	            new NoViableAltException("", 9, 0, input);

            	        throw nvae;
            	    }

            	    switch (alt9) {
            	        case 1 :
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:530:3: ( () otherlv_2= '*' )
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:530:3: ( () otherlv_2= '*' )
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:530:4: () otherlv_2= '*'
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:530:4: ()
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:531:5: 
            	            {

            	                    current = forceCreateModelElementAndSet(
            	                        grammarAccess.getMultiplicationAccess().getMultiLeftAction_1_0_0_0(),
            	                        current);
            	                

            	            }

            	            otherlv_2=(Token)match(input,23,FOLLOW_23_in_ruleMultiplication1202); 

            	                	newLeafNode(otherlv_2, grammarAccess.getMultiplicationAccess().getAsteriskKeyword_1_0_0_1());
            	                

            	            }


            	            }
            	            break;
            	        case 2 :
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:541:6: ( () otherlv_4= '/' )
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:541:6: ( () otherlv_4= '/' )
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:541:7: () otherlv_4= '/'
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:541:7: ()
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:542:5: 
            	            {

            	                    current = forceCreateModelElementAndSet(
            	                        grammarAccess.getMultiplicationAccess().getDivLeftAction_1_0_1_0(),
            	                        current);
            	                

            	            }

            	            otherlv_4=(Token)match(input,24,FOLLOW_24_in_ruleMultiplication1231); 

            	                	newLeafNode(otherlv_4, grammarAccess.getMultiplicationAccess().getSolidusKeyword_1_0_1_1());
            	                

            	            }


            	            }
            	            break;
            	        case 3 :
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:552:6: ( () otherlv_6= '%' )
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:552:6: ( () otherlv_6= '%' )
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:552:7: () otherlv_6= '%'
            	            {
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:552:7: ()
            	            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:553:5: 
            	            {

            	                    current = forceCreateModelElementAndSet(
            	                        grammarAccess.getMultiplicationAccess().getModLeftAction_1_0_2_0(),
            	                        current);
            	                

            	            }

            	            otherlv_6=(Token)match(input,25,FOLLOW_25_in_ruleMultiplication1260); 

            	                	newLeafNode(otherlv_6, grammarAccess.getMultiplicationAccess().getPercentSignKeyword_1_0_2_1());
            	                

            	            }


            	            }
            	            break;

            	    }

            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:562:3: ( (lv_right_7_0= rulePrimaryExpression ) )
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:563:1: (lv_right_7_0= rulePrimaryExpression )
            	    {
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:563:1: (lv_right_7_0= rulePrimaryExpression )
            	    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:564:3: lv_right_7_0= rulePrimaryExpression
            	    {
            	     
            	    	        newCompositeNode(grammarAccess.getMultiplicationAccess().getRightPrimaryExpressionParserRuleCall_1_1_0()); 
            	    	    
            	    pushFollow(FOLLOW_rulePrimaryExpression_in_ruleMultiplication1283);
            	    lv_right_7_0=rulePrimaryExpression();

            	    state._fsp--;


            	    	        if (current==null) {
            	    	            current = createModelElementForParent(grammarAccess.getMultiplicationRule());
            	    	        }
            	           		set(
            	           			current, 
            	           			"right",
            	            		lv_right_7_0, 
            	            		"PrimaryExpression");
            	    	        afterParserOrEnumRuleCall();
            	    	    

            	    }


            	    }


            	    }
            	    break;

            	default :
            	    break loop10;
                }
            } while (true);


            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "ruleMultiplication"


    // $ANTLR start "entryRulePrimaryExpression"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:588:1: entryRulePrimaryExpression returns [EObject current=null] : iv_rulePrimaryExpression= rulePrimaryExpression EOF ;
    public final EObject entryRulePrimaryExpression() throws RecognitionException {
        EObject current = null;

        EObject iv_rulePrimaryExpression = null;


        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:589:2: (iv_rulePrimaryExpression= rulePrimaryExpression EOF )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:590:2: iv_rulePrimaryExpression= rulePrimaryExpression EOF
            {
             newCompositeNode(grammarAccess.getPrimaryExpressionRule()); 
            pushFollow(FOLLOW_rulePrimaryExpression_in_entryRulePrimaryExpression1321);
            iv_rulePrimaryExpression=rulePrimaryExpression();

            state._fsp--;

             current =iv_rulePrimaryExpression; 
            match(input,EOF,FOLLOW_EOF_in_entryRulePrimaryExpression1331); 

            }

        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "entryRulePrimaryExpression"


    // $ANTLR start "rulePrimaryExpression"
    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:597:1: rulePrimaryExpression returns [EObject current=null] : ( (otherlv_0= '(' ( (lv_brackexpr_1_0= ruleExpression ) ) otherlv_2= ')' ) | ( () ( (lv_value_4_0= RULE_NUMBER ) ) ) | ( () ( (otherlv_6= RULE_MNAME ) ) ) | ( () ( (lv_bim_8_0= RULE_BUILT_IN_MODES ) ) ) ) ;
    public final EObject rulePrimaryExpression() throws RecognitionException {
        EObject current = null;

        Token otherlv_0=null;
        Token otherlv_2=null;
        Token lv_value_4_0=null;
        Token otherlv_6=null;
        Token lv_bim_8_0=null;
        EObject lv_brackexpr_1_0 = null;


         enterRule(); 
            
        try {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:600:28: ( ( (otherlv_0= '(' ( (lv_brackexpr_1_0= ruleExpression ) ) otherlv_2= ')' ) | ( () ( (lv_value_4_0= RULE_NUMBER ) ) ) | ( () ( (otherlv_6= RULE_MNAME ) ) ) | ( () ( (lv_bim_8_0= RULE_BUILT_IN_MODES ) ) ) ) )
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:601:1: ( (otherlv_0= '(' ( (lv_brackexpr_1_0= ruleExpression ) ) otherlv_2= ')' ) | ( () ( (lv_value_4_0= RULE_NUMBER ) ) ) | ( () ( (otherlv_6= RULE_MNAME ) ) ) | ( () ( (lv_bim_8_0= RULE_BUILT_IN_MODES ) ) ) )
            {
            // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:601:1: ( (otherlv_0= '(' ( (lv_brackexpr_1_0= ruleExpression ) ) otherlv_2= ')' ) | ( () ( (lv_value_4_0= RULE_NUMBER ) ) ) | ( () ( (otherlv_6= RULE_MNAME ) ) ) | ( () ( (lv_bim_8_0= RULE_BUILT_IN_MODES ) ) ) )
            int alt11=4;
            switch ( input.LA(1) ) {
            case 26:
                {
                alt11=1;
                }
                break;
            case RULE_NUMBER:
                {
                alt11=2;
                }
                break;
            case RULE_MNAME:
                {
                alt11=3;
                }
                break;
            case RULE_BUILT_IN_MODES:
                {
                alt11=4;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 11, 0, input);

                throw nvae;
            }

            switch (alt11) {
                case 1 :
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:601:2: (otherlv_0= '(' ( (lv_brackexpr_1_0= ruleExpression ) ) otherlv_2= ')' )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:601:2: (otherlv_0= '(' ( (lv_brackexpr_1_0= ruleExpression ) ) otherlv_2= ')' )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:601:4: otherlv_0= '(' ( (lv_brackexpr_1_0= ruleExpression ) ) otherlv_2= ')'
                    {
                    otherlv_0=(Token)match(input,26,FOLLOW_26_in_rulePrimaryExpression1369); 

                        	newLeafNode(otherlv_0, grammarAccess.getPrimaryExpressionAccess().getLeftParenthesisKeyword_0_0());
                        
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:605:1: ( (lv_brackexpr_1_0= ruleExpression ) )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:606:1: (lv_brackexpr_1_0= ruleExpression )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:606:1: (lv_brackexpr_1_0= ruleExpression )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:607:3: lv_brackexpr_1_0= ruleExpression
                    {
                     
                    	        newCompositeNode(grammarAccess.getPrimaryExpressionAccess().getBrackexprExpressionParserRuleCall_0_1_0()); 
                    	    
                    pushFollow(FOLLOW_ruleExpression_in_rulePrimaryExpression1390);
                    lv_brackexpr_1_0=ruleExpression();

                    state._fsp--;


                    	        if (current==null) {
                    	            current = createModelElementForParent(grammarAccess.getPrimaryExpressionRule());
                    	        }
                           		set(
                           			current, 
                           			"brackexpr",
                            		lv_brackexpr_1_0, 
                            		"Expression");
                    	        afterParserOrEnumRuleCall();
                    	    

                    }


                    }

                    otherlv_2=(Token)match(input,27,FOLLOW_27_in_rulePrimaryExpression1402); 

                        	newLeafNode(otherlv_2, grammarAccess.getPrimaryExpressionAccess().getRightParenthesisKeyword_0_2());
                        

                    }


                    }
                    break;
                case 2 :
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:628:6: ( () ( (lv_value_4_0= RULE_NUMBER ) ) )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:628:6: ( () ( (lv_value_4_0= RULE_NUMBER ) ) )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:628:7: () ( (lv_value_4_0= RULE_NUMBER ) )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:628:7: ()
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:629:5: 
                    {

                            current = forceCreateModelElement(
                                grammarAccess.getPrimaryExpressionAccess().getNumberLiteralAction_1_0(),
                                current);
                        

                    }

                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:634:2: ( (lv_value_4_0= RULE_NUMBER ) )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:635:1: (lv_value_4_0= RULE_NUMBER )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:635:1: (lv_value_4_0= RULE_NUMBER )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:636:3: lv_value_4_0= RULE_NUMBER
                    {
                    lv_value_4_0=(Token)match(input,RULE_NUMBER,FOLLOW_RULE_NUMBER_in_rulePrimaryExpression1436); 

                    			newLeafNode(lv_value_4_0, grammarAccess.getPrimaryExpressionAccess().getValueNUMBERTerminalRuleCall_1_1_0()); 
                    		

                    	        if (current==null) {
                    	            current = createModelElement(grammarAccess.getPrimaryExpressionRule());
                    	        }
                           		setWithLastConsumed(
                           			current, 
                           			"value",
                            		lv_value_4_0, 
                            		"NUMBER");
                    	    

                    }


                    }


                    }


                    }
                    break;
                case 3 :
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:653:6: ( () ( (otherlv_6= RULE_MNAME ) ) )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:653:6: ( () ( (otherlv_6= RULE_MNAME ) ) )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:653:7: () ( (otherlv_6= RULE_MNAME ) )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:653:7: ()
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:654:5: 
                    {

                            current = forceCreateModelElement(
                                grammarAccess.getPrimaryExpressionAccess().getNumberLiteralAction_2_0(),
                                current);
                        

                    }

                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:659:2: ( (otherlv_6= RULE_MNAME ) )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:660:1: (otherlv_6= RULE_MNAME )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:660:1: (otherlv_6= RULE_MNAME )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:661:3: otherlv_6= RULE_MNAME
                    {

                    			if (current==null) {
                    	            current = createModelElement(grammarAccess.getPrimaryExpressionRule());
                    	        }
                            
                    otherlv_6=(Token)match(input,RULE_MNAME,FOLLOW_RULE_MNAME_in_rulePrimaryExpression1478); 

                    		newLeafNode(otherlv_6, grammarAccess.getPrimaryExpressionAccess().getModeModeCrossReference_2_1_0()); 
                    	

                    }


                    }


                    }


                    }
                    break;
                case 4 :
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:673:6: ( () ( (lv_bim_8_0= RULE_BUILT_IN_MODES ) ) )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:673:6: ( () ( (lv_bim_8_0= RULE_BUILT_IN_MODES ) ) )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:673:7: () ( (lv_bim_8_0= RULE_BUILT_IN_MODES ) )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:673:7: ()
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:674:5: 
                    {

                            current = forceCreateModelElement(
                                grammarAccess.getPrimaryExpressionAccess().getNumberLiteralAction_3_0(),
                                current);
                        

                    }

                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:679:2: ( (lv_bim_8_0= RULE_BUILT_IN_MODES ) )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:680:1: (lv_bim_8_0= RULE_BUILT_IN_MODES )
                    {
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:680:1: (lv_bim_8_0= RULE_BUILT_IN_MODES )
                    // ../edu.uwaterloo.bicycle/src-gen/edu/uwaterloo/bicycle/parser/antlr/internal/InternalModeLanguage.g:681:3: lv_bim_8_0= RULE_BUILT_IN_MODES
                    {
                    lv_bim_8_0=(Token)match(input,RULE_BUILT_IN_MODES,FOLLOW_RULE_BUILT_IN_MODES_in_rulePrimaryExpression1512); 

                    			newLeafNode(lv_bim_8_0, grammarAccess.getPrimaryExpressionAccess().getBimBUILT_IN_MODESTerminalRuleCall_3_1_0()); 
                    		

                    	        if (current==null) {
                    	            current = createModelElement(grammarAccess.getPrimaryExpressionRule());
                    	        }
                           		setWithLastConsumed(
                           			current, 
                           			"bim",
                            		lv_bim_8_0, 
                            		"BUILT_IN_MODES");
                    	    

                    }


                    }


                    }


                    }
                    break;

            }


            }

             leaveRule(); 
        }
         
            catch (RecognitionException re) { 
                recover(input,re); 
                appendSkippedTokens();
            } 
        finally {
        }
        return current;
    }
    // $ANTLR end "rulePrimaryExpression"

    // Delegated rules


 

    public static final BitSet FOLLOW_ruleModel_in_entryRuleModel75 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleModel85 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleMode_in_ruleModel130 = new BitSet(new long[]{0x0000000000000802L});
    public static final BitSet FOLLOW_ruleMode_in_entryRuleMode166 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleMode176 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_11_in_ruleMode213 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_RULE_MNAME_in_ruleMode230 = new BitSet(new long[]{0x0000000000003000L});
    public static final BitSet FOLLOW_12_in_ruleMode253 = new BitSet(new long[]{0x0000000000002000L});
    public static final BitSet FOLLOW_13_in_ruleMode279 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_RULE_TYPES_in_ruleMode296 = new BitSet(new long[]{0x000000000000C000L});
    public static final BitSet FOLLOW_14_in_ruleMode314 = new BitSet(new long[]{0x00000000040000D0L});
    public static final BitSet FOLLOW_ruleConditions_in_ruleMode335 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_15_in_ruleMode349 = new BitSet(new long[]{0x00000000040000D0L});
    public static final BitSet FOLLOW_ruleExpression_in_ruleMode370 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleConditions_in_entryRuleConditions406 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleConditions416 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleCompoundCondition_in_ruleConditions462 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleCompoundCondition_in_entryRuleCompoundCondition496 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleCompoundCondition506 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleCondition_in_ruleCompoundCondition553 = new BitSet(new long[]{0x0000000000030002L});
    public static final BitSet FOLLOW_16_in_ruleCompoundCondition576 = new BitSet(new long[]{0x00000000040000D0L});
    public static final BitSet FOLLOW_17_in_ruleCompoundCondition605 = new BitSet(new long[]{0x00000000040000D0L});
    public static final BitSet FOLLOW_ruleCondition_in_ruleCompoundCondition628 = new BitSet(new long[]{0x0000000000030002L});
    public static final BitSet FOLLOW_ruleCondition_in_entryRuleCondition666 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleCondition676 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleExpression_in_ruleCondition723 = new BitSet(new long[]{0x00000000001C0000L});
    public static final BitSet FOLLOW_18_in_ruleCondition745 = new BitSet(new long[]{0x00000000040000D0L});
    public static final BitSet FOLLOW_19_in_ruleCondition774 = new BitSet(new long[]{0x00000000040000D0L});
    public static final BitSet FOLLOW_20_in_ruleCondition803 = new BitSet(new long[]{0x00000000040000D0L});
    public static final BitSet FOLLOW_ruleExpression_in_ruleCondition826 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleExpression_in_entryRuleExpression862 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleExpression872 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleAddition_in_ruleExpression918 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleAddition_in_entryRuleAddition952 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleAddition962 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ruleMultiplication_in_ruleAddition1009 = new BitSet(new long[]{0x0000000000600002L});
    public static final BitSet FOLLOW_21_in_ruleAddition1032 = new BitSet(new long[]{0x00000000040000D0L});
    public static final BitSet FOLLOW_22_in_ruleAddition1061 = new BitSet(new long[]{0x00000000040000D0L});
    public static final BitSet FOLLOW_ruleMultiplication_in_ruleAddition1084 = new BitSet(new long[]{0x0000000000600002L});
    public static final BitSet FOLLOW_ruleMultiplication_in_entryRuleMultiplication1122 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRuleMultiplication1132 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_rulePrimaryExpression_in_ruleMultiplication1179 = new BitSet(new long[]{0x0000000003800002L});
    public static final BitSet FOLLOW_23_in_ruleMultiplication1202 = new BitSet(new long[]{0x00000000040000D0L});
    public static final BitSet FOLLOW_24_in_ruleMultiplication1231 = new BitSet(new long[]{0x00000000040000D0L});
    public static final BitSet FOLLOW_25_in_ruleMultiplication1260 = new BitSet(new long[]{0x00000000040000D0L});
    public static final BitSet FOLLOW_rulePrimaryExpression_in_ruleMultiplication1283 = new BitSet(new long[]{0x0000000003800002L});
    public static final BitSet FOLLOW_rulePrimaryExpression_in_entryRulePrimaryExpression1321 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_entryRulePrimaryExpression1331 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_26_in_rulePrimaryExpression1369 = new BitSet(new long[]{0x00000000040000D0L});
    public static final BitSet FOLLOW_ruleExpression_in_rulePrimaryExpression1390 = new BitSet(new long[]{0x0000000008000000L});
    public static final BitSet FOLLOW_27_in_rulePrimaryExpression1402 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_RULE_NUMBER_in_rulePrimaryExpression1436 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_RULE_MNAME_in_rulePrimaryExpression1478 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_RULE_BUILT_IN_MODES_in_rulePrimaryExpression1512 = new BitSet(new long[]{0x0000000000000002L});

}